package brad.zimmerman.dungeon.game;

public class ClassEnemyStats {
	int health, currentHealth, attack, extraLives, identifier, level;
	int healthMod, attackMod;
	boolean mburn, poison, MRnorm, MRplus, PRnorm, PRplus, forget, blind, weakness, magicAttack, undead, petrified;
	boolean ePoisoned, coward, banisher, fStrike, sHUD;
	ClassEnemyStats(int health, int attack, int extraLives, int identifier, 
			boolean mburn, boolean poison, boolean MRnorm, boolean MRplus, 
			boolean PRnorm, boolean PRplus, boolean forget, boolean blind, boolean weakness, 
			boolean magicAttack, boolean undead, boolean coward, boolean banisher, boolean fStrike, boolean sHUD){
		this.healthMod = health;
		this.attackMod = attack;
		this.extraLives = extraLives;
		this.identifier = identifier;
		this.mburn = mburn;
		this.poison = poison; 
		this.MRnorm = MRnorm; 
		this.MRplus = MRplus; 
		this.PRnorm = PRnorm;
		this.PRplus = PRplus;
		this.forget = forget;
		this.petrified = false;
		this.blind = blind;
		this.weakness = weakness;
		this.magicAttack = magicAttack;
		this.undead = undead;
		this.ePoisoned = false;
		this.coward = coward;
		this.banisher = banisher;
		this.fStrike = fStrike;
		this.sHUD = sHUD;
	}
	public boolean modNumber(int number){
		switch(number){
		case 0:return this.mburn;
		case 1:return this.poison;
		case 2:return this.MRnorm;
		case 3:return this.MRplus;
		case 4:return this.PRnorm;
		case 5:return this.PRplus;
		case 6:return this.forget;
		case 7:return this.blind;
		case 8:return this.weakness;
		case 9:return this.ePoisoned;
		case 10:return this.magicAttack;
		case 11:return this.undead;
		case 12:return false;
		case 13:return this.fStrike;
		case 14:return this.coward;
		case 15:return this.banisher;
		case 16:return this.sHUD;
		default: return false;
		}
	}
	public void setLevel(int enemyLevel){
		//Health (n+3)^2 - 10
		//Attack (n^2/2)+(5*n/2)
		//this.health = this.health*enemyLevel;
		//if(this.identifier != 1){
		this.health = (int) (Math.pow((enemyLevel+3),2) -10);
		this.health = (int)(((float)this.health) * (((float)this.healthMod)/10));
		//}else{
		//	this.health = 1;
		//}
		//this.attack = this.attack + enemyLevel*5;
		this.attack = (int) ((((float)Math.pow(enemyLevel, 2))/2) + (((float)5*enemyLevel)/2));
		this.attack = (int) (this.attack * (((float)this.attackMod)/10));
		if (this.attack < 1){this.attack = 1;}
		if (this.health < 1){this.health = 1;}
		
		if(this.identifier == 1){
			this.extraLives = enemyLevel;
		}
		if(enemyLevel==10){
			this.health *= 1.75;
		}
		
		this.currentHealth = this.health;
		
		this.level = enemyLevel;
		
	}
	public void setDifficulty(float difficulty){
		this.health *= difficulty; 
		this.currentHealth = health;
		this.attack *= difficulty;
		if(this.health<=1){this.health = 1;this.currentHealth = 1;}
		if(this.attack<=1){this.attack = 1;}
	}
	public void printStats(){
		System.out.println(health +" "+ attack +" "+ extraLives+ " "+ identifier);
	}
	public int getHealth(){
		return health;
	}
	public int getCurrentHealth(){
		return currentHealth;
	}
	public int getAttack(){
		return attack;
	}
	public int getLives(){
		return extraLives;
	}
	public int returnMonster(){
		return this.identifier;
	}
	public int returnLevel(){
		return this.level;
	}
}
